﻿using System;
using System.Collections.Generic;
using System.Text.RegularExpressions;
using KKSG;
using XMainClient.UI;
using XMainClient.UI.UICommon;
using XUtliPoolLib;

namespace XMainClient
{
	// Token: 0x020008EB RID: 2283
	internal class GroupChatDocument : XDocComponent
	{
		// Token: 0x17002AFC RID: 11004
		// (get) Token: 0x060089FF RID: 35327 RVA: 0x00122F44 File Offset: 0x00121144
		public override uint ID
		{
			get
			{
				return GroupChatDocument.uuID;
			}
		}

		// Token: 0x06008A00 RID: 35328 RVA: 0x000FEEFC File Offset: 0x000FD0FC
		protected override void OnReconnected(XReconnectedEventArgs arg)
		{
		}

		// Token: 0x06008A01 RID: 35329 RVA: 0x00122F5B File Offset: 0x0012115B
		public static void Execute(OnLoadedCallback callback = null)
		{
			GroupChatDocument.AsyncLoader.AddTask("Table/GroupStageType", GroupChatDocument._stageTypeReader, false);
			GroupChatDocument.AsyncLoader.Execute(callback);
		}

		// Token: 0x06008A02 RID: 35330 RVA: 0x00122F80 File Offset: 0x00121180
		public static void OnTableLoaded()
		{
			bool flag = GroupChatDocument._stage2exps != null;
			if (flag)
			{
				GroupChatDocument._stage2exps.Clear();
				GroupChatDocument._stage2exps = null;
			}
		}

		// Token: 0x06008A03 RID: 35331 RVA: 0x00122FB0 File Offset: 0x001211B0
		public static uint GetStageID(uint expID)
		{
			bool flag = GroupChatDocument._stage2exps == null;
			if (flag)
			{
				GroupChatDocument._stage2exps = new Dictionary<uint, uint>();
				int num = GroupChatDocument._stageTypeReader.Table.Length;
				for (int i = 0; i < num; i++)
				{
					GroupStageType.RowData rowData = GroupChatDocument._stageTypeReader.Table[i];
					bool flag2 = rowData == null || rowData.StagePerent == 0U || GroupChatDocument._stage2exps.ContainsKey((uint)rowData.Stage2Expedition);
					if (!flag2)
					{
						GroupChatDocument._stage2exps.Add((uint)rowData.Stage2Expedition, rowData.StageID);
					}
				}
			}
			return (XSingleton<XGameSysMgr>.singleton.IsSystemOpened(XSysDefine.XSys_GroupRecruit) && GroupChatDocument._stage2exps.ContainsKey(expID)) ? GroupChatDocument._stage2exps[expID] : 0U;
		}

		// Token: 0x06008A04 RID: 35332 RVA: 0x00123074 File Offset: 0x00121274
		public static GroupStageType.RowData[] GetStageTable()
		{
			return GroupChatDocument._stageTypeReader.Table;
		}

		// Token: 0x06008A05 RID: 35333 RVA: 0x00123090 File Offset: 0x00121290
		public static GroupStageType.RowData GetGroupStage(uint stageID)
		{
			bool flag = stageID == 0U;
			GroupStageType.RowData result;
			if (flag)
			{
				result = null;
			}
			else
			{
				result = GroupChatDocument._stageTypeReader.GetByStageID(stageID);
			}
			return result;
		}

		// Token: 0x06008A06 RID: 35334 RVA: 0x001230BC File Offset: 0x001212BC
		public static bool TryGetParentStage(uint stageID, out uint parentID)
		{
			parentID = 0U;
			GroupStageType.RowData byStageID = GroupChatDocument._stageTypeReader.GetByStageID(stageID);
			bool flag = byStageID == null;
			bool result;
			if (flag)
			{
				result = false;
			}
			else
			{
				parentID = byStageID.StagePerent;
				result = (parentID > 0U);
			}
			return result;
		}

		// Token: 0x17002AFD RID: 11005
		// (get) Token: 0x06008A07 RID: 35335 RVA: 0x001230F8 File Offset: 0x001212F8
		public CBrifGroupInfo currGroup
		{
			get
			{
				bool flag = this.groups != null;
				if (flag)
				{
					foreach (CBrifGroupInfo cbrifGroupInfo in this.groups)
					{
						if(cbrifGroupInfo.id == DlgBase<XChatView, XChatBehaviour>.singleton.ChatGroupId)
                        {
							return cbrifGroupInfo;
						}
// 						bool flag2 = cbrifGroupInfo.id == DlgBase<XChatView, XChatBehaviour>.singleton.ChatGroupId;
// 						if (flag2)
// 						{
// 							HashSet<CBrifGroupInfo>.Enumerator enumerator;
// 							return enumerator.Current;
// 						}
					}
				}
				return null;
			}
		}

		// Token: 0x06008A08 RID: 35336 RVA: 0x00123160 File Offset: 0x00121360
		public bool TryGetGroupInMine(ref List<CBrifGroupInfo> list)
		{
			bool flag = this.groups == null;
			bool result;
			if (flag)
			{
				result = false;
			}
			else
			{
				foreach (CBrifGroupInfo cbrifGroupInfo in this.groups)
				{
					if(cbrifGroupInfo.leaderid == XSingleton<XAttributeMgr>.singleton.XPlayerData.RoleID)
                    {
						list.Add(cbrifGroupInfo);

					}
// 					bool flag2 = cbrifGroupInfo.leaderid == XSingleton<XAttributeMgr>.singleton.XPlayerData.RoleID;
// 					if (flag2)
// 					{
// 						HashSet<CBrifGroupInfo>.Enumerator enumerator;
// 						list.Add(enumerator.Current);
// 					}
				}
				result = true;
			}
			return result;
		}

		// Token: 0x06008A09 RID: 35337 RVA: 0x001231D4 File Offset: 0x001213D4
		public void AddChat2Group(ChatInfo chatInfo)
		{
			bool flag = this.groups == null;
			if (flag)
			{
				this.groups = new HashSet<CBrifGroupInfo>();
			}
			bool flag2 = !this.ContainGroup(chatInfo.group.groupchatID);
			if (flag2)
			{
				CBrifGroupInfo cbrifGroupInfo = new CBrifGroupInfo();
				cbrifGroupInfo.id = chatInfo.group.groupchatID;
				cbrifGroupInfo.msgtime = chatInfo.mTime;
				cbrifGroupInfo.name = chatInfo.group.groupchatName;
				cbrifGroupInfo.memberCnt = chatInfo.group.rolecount;
				cbrifGroupInfo.createtype = chatInfo.group.createtype;
				cbrifGroupInfo.LoopID = XSingleton<XCommon>.singleton.XHash(cbrifGroupInfo.name + cbrifGroupInfo.id + cbrifGroupInfo.memberCnt);
				cbrifGroupInfo.captain = (chatInfo.group.leaderRoleID == XSingleton<XAttributeMgr>.singleton.XPlayerData.RoleID);
				cbrifGroupInfo.chat = chatInfo.mContent;
				cbrifGroupInfo.rolename = chatInfo.mSenderName;
				cbrifGroupInfo.leaderid = chatInfo.group.leaderRoleID;
				cbrifGroupInfo.createTime = chatInfo.group.groupcreatetime;
				bool flag3 = !this.groups.Add(cbrifGroupInfo);
				if (flag3)
				{
					XSingleton<XDebug>.singleton.AddErrorLog("exits group id: ", chatInfo.group.groupchatID.ToString(), null, null, null, null);
				}
				DlgBase<XChatView, XChatBehaviour>.singleton.ProcessGroupMsg();
			}
			else
			{
				foreach (CBrifGroupInfo cbrifGroupInfo2 in this.groups)
				{
					if(cbrifGroupInfo2.id == chatInfo.group.groupchatID)
                    {
						cbrifGroupInfo2.chat = chatInfo.mContent;
						cbrifGroupInfo2.msgtime = chatInfo.mTime;
						cbrifGroupInfo2.rolename = chatInfo.mSenderName;
						cbrifGroupInfo2.memberCnt = chatInfo.group.rolecount;
						cbrifGroupInfo2.LoopID = XSingleton<XCommon>.singleton.XHash(cbrifGroupInfo2.name + cbrifGroupInfo2.id + cbrifGroupInfo2.memberCnt);
                        break;
                    }
// 					bool flag4 = cbrifGroupInfo2.id == chatInfo.group.groupchatID;
// 					if (flag4)
// 					{
// 						HashSet<CBrifGroupInfo>.Enumerator enumerator;
// 						enumerator.Current.chat = chatInfo.mContent;
// 						enumerator.Current.msgtime = chatInfo.mTime;
// 						enumerator.Current.rolename = chatInfo.mSenderName;
// 						enumerator.Current.memberCnt = chatInfo.group.rolecount;
// 						enumerator.Current.LoopID = XSingleton<XCommon>.singleton.XHash(enumerator.Current.name + enumerator.Current.id + enumerator.Current.memberCnt);
// 						break;
// 					}
				}
			}
			bool flag5 = DlgBase<RecruitGroupPublishView, RecruitGroupPublishBehaviour>.singleton.IsVisible();
			if (flag5)
			{
				DlgBase<RecruitGroupPublishView, RecruitGroupPublishBehaviour>.singleton.Refresh();
			}
		}

		// Token: 0x06008A0A RID: 35338 RVA: 0x00123444 File Offset: 0x00121644
		private bool ContainGroup(ulong groupid)
		{
			bool flag = this.groups == null;
			bool result;
			if (flag)
			{
				result = false;
			}
			else
			{
				foreach (CBrifGroupInfo cbrifGroupInfo in this.groups)
				{
					bool flag2 = cbrifGroupInfo.id == groupid;
					if (flag2)
					{
						return true;
					}
				}
				result = false;
			}
			return result;
		}

		// Token: 0x06008A0B RID: 35339 RVA: 0x0012349C File Offset: 0x0012169C
		public bool ReqCreateGroupChat(string groupname, uint type = 1U)
		{
			groupname = groupname.Trim();
			string pattern = "^[0-9a-fA-F]{6}$";
			string pattern2 = "^[0-9a-fA-F]{2}$";
			bool flag = string.IsNullOrEmpty(groupname) || groupname.Equals(XStringDefineProxy.GetString("CHAT_GROUP_DEF"));
			bool result;
			if (flag)
			{
				XSingleton<UiUtility>.singleton.ShowSystemTip(XStringDefineProxy.GetString("CHAT_GROUP_LEFT"), "fece00");
				result = false;
			}
			else
			{
				bool flag2 = Regex.IsMatch(groupname, pattern) || Regex.IsMatch(groupname, pattern2) || groupname.Contains("[") || groupname.Contains("]");
				if (flag2)
				{
					XSingleton<UiUtility>.singleton.ShowSystemTip(XStringDefineProxy.GetString("CHAT_INVALID"), "fece00");
					result = false;
				}
				else
				{
					RpcC2M_GroupChatCreate rpcC2M_GroupChatCreate = new RpcC2M_GroupChatCreate();
					rpcC2M_GroupChatCreate.oArg.groupchatName = groupname;
					rpcC2M_GroupChatCreate.oArg.createtype = type;
					XSingleton<XClientNetwork>.singleton.Send(rpcC2M_GroupChatCreate);
					result = true;
				}
			}
			return result;
		}

		// Token: 0x06008A0C RID: 35340 RVA: 0x00123588 File Offset: 0x00121788
		public void ResCreateGroupChat(GroupChatCreateC2S arg, GroupChatCreateS2C res)
		{
			bool flag = this.SelectGroupHandler != null && this.SelectGroupHandler.IsVisible();
			if (flag)
			{
				this.SelectGroupHandler.SetupSelectGroup(res.groupchatID);
			}
		}

		// Token: 0x06008A0D RID: 35341 RVA: 0x001235C4 File Offset: 0x001217C4
		public void ReqClearGroup()
		{
			RpcC2M_GroupChatClear rpc = new RpcC2M_GroupChatClear();
			XSingleton<XClientNetwork>.singleton.Send(rpc);
		}

		// Token: 0x06008A0E RID: 35342 RVA: 0x001235E4 File Offset: 0x001217E4
		public void ReqGetGroupInfo(ulong groupid)
		{
			RpcC2M_GroupChatGetGroupInfo rpcC2M_GroupChatGetGroupInfo = new RpcC2M_GroupChatGetGroupInfo();
			rpcC2M_GroupChatGetGroupInfo.oArg.groupchatID = groupid;
			XSingleton<XClientNetwork>.singleton.Send(rpcC2M_GroupChatGetGroupInfo);
		}

		// Token: 0x06008A0F RID: 35343 RVA: 0x00123614 File Offset: 0x00121814
		public void ResGroupInfo(List<GroupChatPlayerInfo> playerlist)
		{
			bool flag = this.players == null;
			if (flag)
			{
				this.players = new HashSet<CGroupPlayerInfo>();
			}
			else
			{
				this.players.Clear();
			}
			int i = 0;
			int count = playerlist.Count;
			while (i < count)
			{
				GroupChatPlayerInfo groupChatPlayerInfo = playerlist[i];
				CGroupPlayerInfo cgroupPlayerInfo = new CGroupPlayerInfo();
				cgroupPlayerInfo.roleid = groupChatPlayerInfo.roleid;
				cgroupPlayerInfo.rolename = groupChatPlayerInfo.rolename;
				cgroupPlayerInfo.level = groupChatPlayerInfo.level;
				cgroupPlayerInfo.ppt = groupChatPlayerInfo.fighting;
				cgroupPlayerInfo.profession = groupChatPlayerInfo.profession;
				cgroupPlayerInfo.degree = -1;
				cgroupPlayerInfo.uid = groupChatPlayerInfo.uid;
				cgroupPlayerInfo.guild = groupChatPlayerInfo.guild;
				bool flag2 = !this.players.Add(cgroupPlayerInfo);
				if (flag2)
				{
					XSingleton<XDebug>.singleton.AddErrorLog("exist player: ", cgroupPlayerInfo.roleid.ToString(), null, null, null, null);
				}
				i++;
			}
			List<XFriendData> friendData = DlgBase<XFriendsView, XFriendsBehaviour>.singleton.GetFriendData();
			int j = 0;
			int count2 = friendData.Count;
			while (j < count2)
			{
				bool flag3 = this.Exist(friendData[j].roleid);
				if (!flag3)
				{
					CGroupPlayerInfo cgroupPlayerInfo2 = new CGroupPlayerInfo();
					cgroupPlayerInfo2.roleid = friendData[j].roleid;
					cgroupPlayerInfo2.rolename = friendData[j].name;
					cgroupPlayerInfo2.setid = friendData[j].setid;
					cgroupPlayerInfo2.level = friendData[j].level;
					cgroupPlayerInfo2.ppt = friendData[j].powerpoint;
					cgroupPlayerInfo2.degree = (int)friendData[j].degreeAll;
					cgroupPlayerInfo2.profession = friendData[j].profession;
					cgroupPlayerInfo2.uid = friendData[j].uid;
					cgroupPlayerInfo2.guild = friendData[j].guildname;
					bool flag4 = !this.players.Add(cgroupPlayerInfo2);
					if (flag4)
					{
						XSingleton<XDebug>.singleton.AddErrorLog("exist player: ", cgroupPlayerInfo2.roleid.ToString(), null, null, null, null);
					}
				}
				j++;
			}
			bool flag5 = DlgBase<ChatGroupList, ChatGroupBehaviour>.singleton.IsVisible();
			if (flag5)
			{
				DlgBase<ChatGroupList, ChatGroupBehaviour>.singleton.SetCB();
			}
			bool flag6 = DlgBase<ChatMemberList, ChatMemberBehaviour>.singleton.IsVisible();
			if (flag6)
			{
				DlgBase<ChatMemberList, ChatMemberBehaviour>.singleton.Refresh();
			}
		}

		// Token: 0x06008A10 RID: 35344 RVA: 0x00123890 File Offset: 0x00121A90
		private bool Exist(ulong uid)
		{
			foreach (CGroupPlayerInfo cgroupPlayerInfo in this.players)
			{
				bool flag = cgroupPlayerInfo.roleid == uid;
				if (flag)
				{
					return true;
				}
			}
			return false;
		}

		// Token: 0x06008A11 RID: 35345 RVA: 0x001238D8 File Offset: 0x00121AD8
		public void ReqChangePlayer(ulong groupid, List<ulong> add, List<ulong> remove)
		{
			RpcC2M_GroupChatManager rpcC2M_GroupChatManager = new RpcC2M_GroupChatManager();
			rpcC2M_GroupChatManager.oArg.groupchatID = groupid;
			bool flag = add != null;
			if (flag)
			{
				rpcC2M_GroupChatManager.oArg.addrolelist.Clear();
				int i = 0;
				int count = add.Count;
				while (i < count)
				{
					rpcC2M_GroupChatManager.oArg.addrolelist.Add(add[i]);
					i++;
				}
			}
			bool flag2 = remove != null;
			if (flag2)
			{
				rpcC2M_GroupChatManager.oArg.subrolelist.Clear();
				int j = 0;
				int count2 = remove.Count;
				while (j < count2)
				{
					rpcC2M_GroupChatManager.oArg.subrolelist.Add(remove[j]);
					j++;
				}
			}
			XSingleton<XClientNetwork>.singleton.Send(rpcC2M_GroupChatManager);
		}

		// Token: 0x06008A12 RID: 35346 RVA: 0x001239AC File Offset: 0x00121BAC
		public void ResChangePlayer(GroupChatManagerPtc res)
		{
			bool flag = this.players == null;
			if (flag)
			{
				this.players = new HashSet<CGroupPlayerInfo>();
			}
			CGroupPlayerInfo cgroupPlayerInfo = null;
			int i = 0;
			int count = res.subrolelist.Count;
			while (i < count)
			{
				bool flag2 = res.subrolelist[i] == XSingleton<XAttributeMgr>.singleton.XPlayerData.RoleID;
				if (flag2)
				{
					this.ResQuitGroup(res.groupchatID);
					return;
				}
				foreach (CGroupPlayerInfo cgroupPlayerInfo2 in this.players)
				{
					if(cgroupPlayerInfo2.roleid == res.subrolelist[i])
                    {
                        cgroupPlayerInfo = cgroupPlayerInfo2;
                        break;
                    }
// 					bool flag3 = cgroupPlayerInfo2.roleid == res.subrolelist[i];
// 					if (flag3)
// 					{
// 						HashSet<CGroupPlayerInfo>.Enumerator enumerator;
// 						cgroupPlayerInfo = enumerator.Current;
// 						break;
// 					}
				}
				bool flag4 = cgroupPlayerInfo != null;
				if (flag4)
				{
					bool flag5 = DlgBase<XFriendsView, XFriendsBehaviour>.singleton.IsMyFriend(cgroupPlayerInfo.roleid);
					if (flag5)
					{
						cgroupPlayerInfo.degree = (int)DlgBase<XFriendsView, XFriendsBehaviour>.singleton.GetFriendDegreeAll(cgroupPlayerInfo.roleid);
					}
					else
					{
						this.players.Remove(cgroupPlayerInfo);
					}
				}
				i++;
			}
			int j = 0;
			int count2 = res.addrolelist.Count;
			while (j < count2)
			{
				GroupChatPlayerInfo groupChatPlayerInfo = res.addrolelist[j];
				this.TryRmOriginPlayer(groupChatPlayerInfo.roleid);
				CGroupPlayerInfo cgroupPlayerInfo3 = new CGroupPlayerInfo();
				cgroupPlayerInfo3.roleid = groupChatPlayerInfo.roleid;
				cgroupPlayerInfo3.rolename = groupChatPlayerInfo.rolename;
				cgroupPlayerInfo3.level = groupChatPlayerInfo.level;
				cgroupPlayerInfo3.guild = groupChatPlayerInfo.guild;
				cgroupPlayerInfo3.uid = groupChatPlayerInfo.uid;
				cgroupPlayerInfo3.degree = -1;
				cgroupPlayerInfo3.ppt = groupChatPlayerInfo.fighting;
				cgroupPlayerInfo3.profession = groupChatPlayerInfo.profession;
				bool flag6 = !this.players.Add(cgroupPlayerInfo3);
				if (flag6)
				{
					XSingleton<XDebug>.singleton.AddErrorLog("exist player: ", cgroupPlayerInfo3.roleid.ToString(), null, null, null, null);
				}
				j++;
			}
			bool flag7 = DlgBase<ChatGroupList, ChatGroupBehaviour>.singleton.IsVisible();
			if (flag7)
			{
				DlgBase<ChatGroupList, ChatGroupBehaviour>.singleton.Refresh();
				return;
			}
		}

		// Token: 0x06008A13 RID: 35347 RVA: 0x00123BCC File Offset: 0x00121DCC
		private void TryRmOriginPlayer(ulong roleid)
		{
			CGroupPlayerInfo cgroupPlayerInfo = null;
			foreach (CGroupPlayerInfo cgroupPlayerInfo2 in this.players)
			{
				bool flag = cgroupPlayerInfo2.roleid == roleid;
				if (flag)
				{
					//HashSet<CGroupPlayerInfo>.Enumerator enumerator;
					cgroupPlayerInfo = cgroupPlayerInfo2;// enumerator.Current;
					break;
				}
			}
			bool flag2 = cgroupPlayerInfo != null;
			if (flag2)
			{
				this.players.Remove(cgroupPlayerInfo);
			}
		}

		// Token: 0x06008A14 RID: 35348 RVA: 0x00123C2C File Offset: 0x00121E2C
		public void ReqQuitGroup(ulong groupid)
		{
			RpcC2M_GroupChatQuit rpcC2M_GroupChatQuit = new RpcC2M_GroupChatQuit();
			rpcC2M_GroupChatQuit.oArg.groupchatID = groupid;
			XSingleton<XClientNetwork>.singleton.Send(rpcC2M_GroupChatQuit);
		}

		// Token: 0x06008A15 RID: 35349 RVA: 0x00123C5C File Offset: 0x00121E5C
		public void ResQuitGroup(ulong groupid)
		{
			bool flag = this.groups == null;
			if (!flag)
			{
				CBrifGroupInfo cbrifGroupInfo = null;
				foreach (CBrifGroupInfo cbrifGroupInfo2 in this.groups)
				{
					bool flag2 = cbrifGroupInfo2.id == groupid;
					if (flag2)
					{
						//HashSet<CBrifGroupInfo>.Enumerator enumerator;
						cbrifGroupInfo = cbrifGroupInfo2;// enumerator.Current;
						break;
					}
				}
				bool flag3 = cbrifGroupInfo != null;
				if (flag3)
				{
					this.groups.Remove(cbrifGroupInfo);
				}
				DlgBase<XChatView, XChatBehaviour>.singleton.ProcessGroupMsg();
				bool flag4 = DlgBase<ChatGroupList, ChatGroupBehaviour>.singleton.IsVisible();
				if (flag4)
				{
					DlgBase<ChatGroupList, ChatGroupBehaviour>.singleton.SetVisible(false, true);
				}
			}
		}

		// Token: 0x06008A16 RID: 35350 RVA: 0x00123CF8 File Offset: 0x00121EF8
		public void ResDismissGroup(ulong groupid, ulong roleid)
		{
			bool flag = this.groups != null;
			if (flag)
			{
				bool flag2 = roleid == 0UL;
				if (flag2)
				{
				}
				CBrifGroupInfo cbrifGroupInfo = null;
				foreach (CBrifGroupInfo cbrifGroupInfo2 in this.groups)
				{
					bool flag3 = cbrifGroupInfo2.id == groupid;
					if (flag3)
					{
						//HashSet<CBrifGroupInfo>.Enumerator enumerator;
						cbrifGroupInfo = cbrifGroupInfo2;// enumerator.Current;
						break;
					}
				}
				bool flag4 = cbrifGroupInfo != null;
				if (flag4)
				{
					this.groups.Remove(cbrifGroupInfo);
				}
			}
			DlgBase<XChatView, XChatBehaviour>.singleton.ProcessGroupMsg();
		}

		// Token: 0x17002AFE RID: 11006
		// (get) Token: 0x06008A17 RID: 35351 RVA: 0x00123D84 File Offset: 0x00121F84
		// (set) Token: 0x06008A18 RID: 35352 RVA: 0x00123D9C File Offset: 0x00121F9C
		public bool bShowMotion
		{
			get
			{
				return this.m_bShowMotion;
			}
			set
			{
				bool flag = this.m_bShowMotion != value;
				if (flag)
				{
					this.m_bShowMotion = value;
					XSingleton<XDebug>.singleton.AddGreenLog("bShowMotion:" + value.ToString(), null, null, null, null, null);
					DlgBase<XMainInterface, XMainInterfaceBehaviour>.singleton.RefreshH5ButtonState(XSysDefine.XSys_GroupRecruitAuthorize, true);
					XTeamDocument specificDocument = XDocuments.GetSpecificDocument<XTeamDocument>(XTeamDocument.uuID);
					specificDocument.RefreshRedPoint();
					bool flag2 = DlgBase<RecruitView, RecruitBehaviour>.singleton.IsVisible();
					if (flag2)
					{
						DlgBase<RecruitView, RecruitBehaviour>.singleton.RefreshRedPoint();
					}
				}
			}
		}

		// Token: 0x17002AFF RID: 11007
		// (get) Token: 0x06008A19 RID: 35353 RVA: 0x00123E20 File Offset: 0x00122020
		public List<GroupMember> LeaderReviewList
		{
			get
			{
				return this.m_leaderReviewList;
			}
		}

		// Token: 0x17002B00 RID: 11008
		// (get) Token: 0x06008A1A RID: 35354 RVA: 0x00123E38 File Offset: 0x00122038
		public List<GroupMember> RecruitGroup
		{
			get
			{
				return this.m_recruitGroups;
			}
		}

		// Token: 0x17002B01 RID: 11009
		// (get) Token: 0x06008A1B RID: 35355 RVA: 0x00123E50 File Offset: 0x00122050
		public List<GroupMember> RecruitMember
		{
			get
			{
				return this.m_recruitMembers;
			}
		}

		// Token: 0x17002B02 RID: 11010
		// (get) Token: 0x06008A1C RID: 35356 RVA: 0x00123E68 File Offset: 0x00122068
		public uint CurUserMemberCount
		{
			get
			{
				return this.m_curUseMemberCount;
			}
		}

		// Token: 0x17002B03 RID: 11011
		// (get) Token: 0x06008A1D RID: 35357 RVA: 0x00123E80 File Offset: 0x00122080
		public uint CurGroupCount
		{
			get
			{
				return this.m_curUseGroupCount;
			}
		}

		// Token: 0x06008A1E RID: 35358 RVA: 0x00123E98 File Offset: 0x00122098
		public void SysnGroupChatIssueCount(GroupChatIssueCountNtf ntf)
		{
			this.m_curUseGroupCount = ntf.groupcount;
			this.m_curUseMemberCount = ntf.rolecount;
			bool flag = DlgBase<RecruitView, RecruitBehaviour>.singleton.IsVisible();
			if (flag)
			{
				DlgBase<RecruitView, RecruitBehaviour>.singleton.Refresh();
			}
		}

		// Token: 0x06008A1F RID: 35359 RVA: 0x00123ED8 File Offset: 0x001220D8
		public void SendGroupChatFindTeamInfoList(uint index = 0U)
		{
			XSingleton<XDebug>.singleton.AddGreenLog("SendGroupChatFindTeamInfoList", null, null, null, null, null);
			RpcC2M_GroupChatFindTeamInfoList rpcC2M_GroupChatFindTeamInfoList = new RpcC2M_GroupChatFindTeamInfoList();
			rpcC2M_GroupChatFindTeamInfoList.oArg.type = index;
			XSingleton<XClientNetwork>.singleton.Send(rpcC2M_GroupChatFindTeamInfoList);
		}

		// Token: 0x06008A20 RID: 35360 RVA: 0x00123F1C File Offset: 0x0012211C
		public void ReceiveGroupChatFindTeamInfoList(GroupChatFindTeamInfoListS2C res)
		{
			XSingleton<XDebug>.singleton.AddGreenLog("ReceiveGroupChatFindTeamInfoList", null, null, null, null, null);
			this.SetupMemberList(ref this.m_recruitGroups);
			int i = 0;
			int count = res.teamlist.Count;
			while (i < count)
			{
				GroupMember groupMember = GroupMember.Get();
				groupMember.Setup(res.teamlist[i]);
				this.m_recruitGroups.Add(groupMember);
				i++;
			}
			bool flag = DlgBase<RecruitView, RecruitBehaviour>.singleton.IsVisible();
			if (flag)
			{
				DlgBase<RecruitView, RecruitBehaviour>.singleton.Refresh();
			}
		}

		// Token: 0x06008A21 RID: 35361 RVA: 0x00123FAC File Offset: 0x001221AC
		public void SendGroupChatFindRoleInfoList(uint index = 0U)
		{
			XSingleton<XDebug>.singleton.AddGreenLog("SendGroupChatFindRoleInfoList", null, null, null, null, null);
			RpcC2M_GroupChatFindRoleInfoList rpcC2M_GroupChatFindRoleInfoList = new RpcC2M_GroupChatFindRoleInfoList();
			rpcC2M_GroupChatFindRoleInfoList.oArg.type = index;
			XSingleton<XClientNetwork>.singleton.Send(rpcC2M_GroupChatFindRoleInfoList);
		}

		// Token: 0x06008A22 RID: 35362 RVA: 0x00123FF0 File Offset: 0x001221F0
		public void ReceiveGroupChatFindRoleInfoList(GroupChatFindRoleInfoListS2C res)
		{
			XSingleton<XDebug>.singleton.AddGreenLog("ReceiveGroupChatFindRoleInfoList", null, null, null, null, null);
			this.SetupMemberList(ref this.m_recruitMembers);
			int i = 0;
			int count = res.rolelist.Count;
			while (i < count)
			{
				GroupMember groupMember = GroupMember.Get();
				groupMember.Setup(res.rolelist[i]);
				this.m_recruitMembers.Add(groupMember);
				i++;
			}
			bool flag = DlgBase<RecruitView, RecruitBehaviour>.singleton.IsVisible();
			if (flag)
			{
				DlgBase<RecruitView, RecruitBehaviour>.singleton.Refresh();
			}
		}

		// Token: 0x06008A23 RID: 35363 RVA: 0x00124080 File Offset: 0x00122280
		public bool TryGetGroupMember(ulong issueIndex, out GroupMember member)
		{
			member = null;
			bool flag = this.m_recruitMembers == null || issueIndex == 0UL;
			bool result;
			if (flag)
			{
				result = false;
			}
			else
			{
				int i = 0;
				int count = this.m_recruitMembers.Count;
				while (i < count)
				{
					bool flag2 = this.m_recruitMembers[i].issueIndex == issueIndex;
					if (flag2)
					{
						member = this.m_recruitMembers[i];
						return true;
					}
					i++;
				}
				result = false;
			}
			return result;
		}

		// Token: 0x06008A24 RID: 35364 RVA: 0x001240FC File Offset: 0x001222FC
		public void SendGroupChatPlayerInfo(GroupChatFindRoleInfo info)
		{
			XSingleton<XDebug>.singleton.AddGreenLog("SendGroupChatPlayerInfo", null, null, null, null, null);
			RpcC2M_GroupChatPlayerIssueInfo rpcC2M_GroupChatPlayerIssueInfo = new RpcC2M_GroupChatPlayerIssueInfo();
			rpcC2M_GroupChatPlayerIssueInfo.oArg.roleinfo = info;
			XSingleton<XClientNetwork>.singleton.Send(rpcC2M_GroupChatPlayerIssueInfo);
		}

		// Token: 0x06008A25 RID: 35365 RVA: 0x00124140 File Offset: 0x00122340
		public void ReceiveGroupChatPlayerInfo(GroupChatPlayerIssueInfoS2C s2c)
		{
			XSingleton<XDebug>.singleton.AddGreenLog("ReceiveGroupChatPlayerInfo", null, null, null, null, null);
			bool flag = s2c.errorcode > ErrorCode.ERR_SUCCESS;
			if (flag)
			{
				XSingleton<UiUtility>.singleton.ShowSystemTip(s2c.errorcode, "fece00");
			}
			else
			{
				XSingleton<UiUtility>.singleton.ShowSystemTip(ErrorCode.ERR_SUCCESS, "fece00");
				bool flag2 = DlgBase<RecruitView, RecruitBehaviour>.singleton.IsVisible();
				if (flag2)
				{
					DlgBase<RecruitView, RecruitBehaviour>.singleton.ReSelect();
				}
			}
		}

		// Token: 0x06008A26 RID: 35366 RVA: 0x001241B4 File Offset: 0x001223B4
		public void SendGroupChatLeaderInfo(GroupChatFindTeamInfo info)
		{
			RpcC2M_GroupChatLeaderIssueInfo rpcC2M_GroupChatLeaderIssueInfo = new RpcC2M_GroupChatLeaderIssueInfo();
			rpcC2M_GroupChatLeaderIssueInfo.oArg.teaminfo = info;
			XSingleton<XClientNetwork>.singleton.Send(rpcC2M_GroupChatLeaderIssueInfo);
		}

		// Token: 0x06008A27 RID: 35367 RVA: 0x001241E4 File Offset: 0x001223E4
		public void ReceiveGroupChatLeaderInfo(GroupChatLeaderIssueInfoS2C s2c)
		{
			bool flag = s2c.errorcode > ErrorCode.ERR_SUCCESS;
			if (flag)
			{
				XSingleton<UiUtility>.singleton.ShowSystemTip(s2c.errorcode, "fece00");
			}
			else
			{
				XSingleton<UiUtility>.singleton.ShowSystemTip(ErrorCode.ERR_SUCCESS, "fece00");
				bool flag2 = DlgBase<RecruitView, RecruitBehaviour>.singleton.IsVisible();
				if (flag2)
				{
					DlgBase<RecruitView, RecruitBehaviour>.singleton.ReSelect();
				}
			}
		}

		// Token: 0x06008A28 RID: 35368 RVA: 0x00124244 File Offset: 0x00122444
		public void SendGroupChatPlayerApply(ulong index)
		{
			XSingleton<XDebug>.singleton.AddGreenLog("SendGroupChatPlayerApply", null, null, null, null, null);
			RpcC2M_GroupChatPlayerApply rpcC2M_GroupChatPlayerApply = new RpcC2M_GroupChatPlayerApply();
			rpcC2M_GroupChatPlayerApply.oArg.issueIndex = index;
			XSingleton<XClientNetwork>.singleton.Send(rpcC2M_GroupChatPlayerApply);
		}

		// Token: 0x06008A29 RID: 35369 RVA: 0x00124288 File Offset: 0x00122488
		public void ReceiveGroupChatPlayerApply(GroupChatPlayerApplyC2S arg, GroupChatPlayerApplyS2C s2c)
		{
			XSingleton<XDebug>.singleton.AddGreenLog("ReceiveGroupChatPlayerApply", null, null, null, null, null);
			bool flag = s2c.errorcode > ErrorCode.ERR_SUCCESS;
			if (flag)
			{
				this.SynGroupState(arg.issueIndex, 0U);
				XSingleton<UiUtility>.singleton.ShowSystemTip(s2c.errorcode, "fece00");
			}
			else
			{
				this.SynGroupState(arg.issueIndex, 1U);
			}
			bool flag2 = DlgBase<RecruitView, RecruitBehaviour>.singleton.IsVisible();
			if (flag2)
			{
				DlgBase<RecruitView, RecruitBehaviour>.singleton.Refresh();
			}
		}

		// Token: 0x06008A2A RID: 35370 RVA: 0x0012430C File Offset: 0x0012250C
		public void SendZMLeaderAddRole(ulong index, ulong groupID)
		{
			GroupMember groupMember;
			bool flag = this.TryGetGroupMember(index, out groupMember);
			if (flag)
			{
				RpcC2M_GroupChatLeaderAddRole rpcC2M_GroupChatLeaderAddRole = new RpcC2M_GroupChatLeaderAddRole();
				rpcC2M_GroupChatLeaderAddRole.oArg.roleIssueIndex = index;
				rpcC2M_GroupChatLeaderAddRole.oArg.groupchatID = groupID;
				rpcC2M_GroupChatLeaderAddRole.oArg.roleid = groupMember.userID;
				XSingleton<XClientNetwork>.singleton.Send(rpcC2M_GroupChatLeaderAddRole);
			}
		}

		// Token: 0x06008A2B RID: 35371 RVA: 0x00124368 File Offset: 0x00122568
		public void RecevieZMLeaderAddRole(GroupChatLeaderAddRoleC2S c2s, GroupChatLeaderAddRoleS2C s2c)
		{
			bool flag = s2c.errorcode > ErrorCode.ERR_SUCCESS;
			if (flag)
			{
				XSingleton<UiUtility>.singleton.ShowSystemTip(s2c.errorcode, "fece00");
			}
			else
			{
				bool flag2 = this.m_recruitGroups == null;
				if (!flag2)
				{
					int i = 0;
					int count = this.m_recruitMembers.Count;
					while (i < count)
					{
						bool flag3 = this.m_recruitMembers[i].issueIndex == c2s.roleIssueIndex;
						if (flag3)
						{
							this.m_recruitMembers[i].Release();
							this.m_recruitMembers.RemoveAt(i);
							break;
						}
						i++;
					}
					bool flag4 = DlgBase<RecruitView, RecruitBehaviour>.singleton.IsVisible();
					if (flag4)
					{
						DlgBase<RecruitView, RecruitBehaviour>.singleton.Refresh();
					}
				}
			}
		}

		// Token: 0x06008A2C RID: 35372 RVA: 0x0012442C File Offset: 0x0012262C
		private void SynGroupState(ulong index, uint state = 1U)
		{
			bool flag = this.m_recruitGroups != null;
			if (flag)
			{
				int i = 0;
				int count = this.m_recruitGroups.Count;
				while (i < count)
				{
					bool flag2 = this.m_recruitGroups[i].issueIndex == index;
					if (flag2)
					{
						this.m_recruitGroups[i].state = state;
						break;
					}
					i++;
				}
			}
		}

		// Token: 0x06008A2D RID: 35373 RVA: 0x00124498 File Offset: 0x00122698
		public void SendGroupChatLeaderReviewList()
		{
			XSingleton<XDebug>.singleton.AddGreenLog("SendGroupChatLeaderReviewList", null, null, null, null, null);
			RpcC2M_GroupChatLeaderReviewList rpc = new RpcC2M_GroupChatLeaderReviewList();
			XSingleton<XClientNetwork>.singleton.Send(rpc);
		}

		// Token: 0x06008A2E RID: 35374 RVA: 0x001244D0 File Offset: 0x001226D0
		public void ReceiveGroupChatLeaderReviewList(GroupChatLeaderReviewListS2C s2c)
		{
			XSingleton<XDebug>.singleton.AddGreenLog("ReceiveGroupChatLeaderReviewList", null, null, null, null, null);
			bool flag = s2c.errorcode > ErrorCode.ERR_SUCCESS;
			if (flag)
			{
				XSingleton<UiUtility>.singleton.ShowSystemTip(s2c.errorcode, "fece00");
			}
			else
			{
				this.SetupMemberList(ref this.m_leaderReviewList);
				int i = 0;
				int count = s2c.roleinfolist.Count;
				while (i < count)
				{
					GroupMember groupMember = GroupMember.Get();
					groupMember.Setup(s2c.roleinfolist[i]);
					this.m_leaderReviewList.Add(groupMember);
					i++;
				}
				bool flag2 = DlgBase<RecruitAuthorizeView, RecruitAuthorizeBehaviour>.singleton.IsVisible();
				if (flag2)
				{
					DlgBase<RecruitAuthorizeView, RecruitAuthorizeBehaviour>.singleton.RefreshData();
				}
			}
		}

		// Token: 0x06008A2F RID: 35375 RVA: 0x00124588 File Offset: 0x00122788
		public void SendGroupChatLeaderReview(int index, bool isAgree)
		{
			bool flag = this.m_leaderReviewList != null && index < this.m_leaderReviewList.Count;
			if (flag)
			{
				RpcC2M_GroupChatLeaderReview rpcC2M_GroupChatLeaderReview = new RpcC2M_GroupChatLeaderReview();
				GroupMember groupMember = this.m_leaderReviewList[index];
				rpcC2M_GroupChatLeaderReview.oArg.groupchatID = groupMember.groupID;
				rpcC2M_GroupChatLeaderReview.oArg.issueIndex = groupMember.issueIndex;
				rpcC2M_GroupChatLeaderReview.oArg.roleid = groupMember.userID;
				rpcC2M_GroupChatLeaderReview.oArg.isAgree = isAgree;
				XSingleton<XClientNetwork>.singleton.Send(rpcC2M_GroupChatLeaderReview);
			}
		}

		// Token: 0x06008A30 RID: 35376 RVA: 0x00124618 File Offset: 0x00122818
		public void ReceiveGroupChatLeaderReview(GroupChatLeaderReviewC2S arg, GroupChatLeaderReviewS2C s2c)
		{
			bool flag = s2c.errorcode > ErrorCode.ERR_SUCCESS;
			if (flag)
			{
				XSingleton<UiUtility>.singleton.ShowSystemTip(s2c.errorcode, "fece00");
			}
			else
			{
				XSingleton<UiUtility>.singleton.ShowSystemTip(ErrorCode.ERR_SUCCESS, "fece00");
				bool flag2 = this.m_leaderReviewList != null && this.m_leaderReviewList.Count > 0;
				if (flag2)
				{
					int i = 0;
					int count = this.m_leaderReviewList.Count;
					while (i < count)
					{
						bool flag3 = this.m_leaderReviewList[i].issueIndex == arg.issueIndex;
						if (flag3)
						{
							this.m_leaderReviewList[i].Release();
							this.m_leaderReviewList.RemoveAt(i);
							break;
						}
						i++;
					}
				}
				bool flag4 = DlgBase<RecruitAuthorizeView, RecruitAuthorizeBehaviour>.singleton.IsVisible();
				if (flag4)
				{
					DlgBase<RecruitAuthorizeView, RecruitAuthorizeBehaviour>.singleton.RefreshData();
				}
			}
		}

		// Token: 0x06008A31 RID: 35377 RVA: 0x001246FC File Offset: 0x001228FC
		private void SetupMemberList(ref List<GroupMember> memberList)
		{
			bool flag = memberList == null;
			if (flag)
			{
				memberList = new List<GroupMember>();
			}
			bool flag2 = memberList.Count > 0;
			if (flag2)
			{
				int i = 0;
				int count = memberList.Count;
				while (i < count)
				{
					memberList[i].Release();
					i++;
				}
				memberList.Clear();
			}
		}

		// Token: 0x04002BE5 RID: 11237
		public new static readonly uint uuID = XSingleton<XCommon>.singleton.XHash("GroupChatDocument");

		// Token: 0x04002BE6 RID: 11238
		public static XTableAsyncLoader AsyncLoader = new XTableAsyncLoader();

		// Token: 0x04002BE7 RID: 11239
		private static GroupStageType _stageTypeReader = new GroupStageType();

		// Token: 0x04002BE8 RID: 11240
		private static Dictionary<uint, uint> _stage2exps;

		// Token: 0x04002BE9 RID: 11241
		public HashSet<CBrifGroupInfo> groups;

		// Token: 0x04002BEA RID: 11242
		public HashSet<CGroupPlayerInfo> players;

		// Token: 0x04002BEB RID: 11243
		public RecruitSelectGroupHandler SelectGroupHandler = null;

		// Token: 0x04002BEC RID: 11244
		private bool m_bShowMotion = false;

		// Token: 0x04002BED RID: 11245
		private List<GroupMember> m_recruitGroups;

		// Token: 0x04002BEE RID: 11246
		private List<GroupMember> m_leaderReviewList;

		// Token: 0x04002BEF RID: 11247
		private List<GroupMember> m_recruitMembers;

		// Token: 0x04002BF0 RID: 11248
		private uint m_curUseGroupCount = 0U;

		// Token: 0x04002BF1 RID: 11249
		private uint m_curUseMemberCount = 0U;
	}
}
